package Relatorios;

import hibernate.dao.HibernateConnection;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import skin.LookAndFeelSelector;
import utilitarios.JPanelPersonalizavel;
import factory.FabricaDeFrame;

import java.awt.Toolkit;
import java.awt.Window.Type;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

//import Relatorios.estoque.FrmRelatorioEstoque;

public class FrmRelatorios extends JFrame {

	private JPanel contentPane;
	private JLabel lblLogo;
	private JButton btnHistorico;
	private JButton btnMovimentacao;
	private JButton btnEstoque;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					HibernateConnection.init();
					LookAndFeelSelector.lookAndFeelOS();
					FrmRelatorios frame = new FrmRelatorios();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public FrmRelatorios() {
		setTitle("RELATORIOS");
		setIconImage(Toolkit.getDefaultToolkit().getImage("src/Repositorio/icon.png"));
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 421, 300);
		contentPane = new JPanelPersonalizavel("src/Repositorio/pink_waves.png");
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		setLocationRelativeTo(null);
		contentPane.setLayout(null);
		
		btnHistorico = new JButton();
		btnHistorico.setToolTipText("Gerar relat\u00F3rio do hist\u00F3rico de clientes");
		btnHistorico.setIcon(new ImageIcon("src/Repositorio/btn_historic.png"));
		btnHistorico.setBounds(21, 119,100,100);
		contentPane.add(btnHistorico);
		btnHistorico.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				FrmHistorico frame = new FrmHistorico();
				frame.setVisible(true);
				
			}
		});
		
		btnMovimentacao = new JButton();
		btnMovimentacao.setToolTipText("Gerar relat\u00F3rio de movimenta\u00E7\u00E3o");
		btnMovimentacao.setIcon(new ImageIcon("src/Repositorio/btn_movi.png"));
		btnMovimentacao.setBounds(150, 119, 100, 100);
		contentPane.add(btnMovimentacao);
		btnMovimentacao.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				FrmMovimentacao movimentacao = new FrmMovimentacao();
				movimentacao.setVisible(true);
				
			}
		});
		
		btnEstoque = new JButton();
		btnEstoque.setToolTipText("Gerar relat\u00F3rio de estoque dos produtos");
		btnEstoque.setIcon(new ImageIcon("src/Repositorio/btn_relatorioestoque.png"));
		btnEstoque.setBounds(282, 119, 100,100);
		contentPane.add(btnEstoque);
		btnEstoque.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				FrmRelatorioEstoque relEstoque = new FrmRelatorioEstoque();
				relEstoque.setVisible(true);				
			}
		});
		
		lblLogo = new JLabel("");
		lblLogo.setIcon(new ImageIcon("src/Repositorio/logo2.png"));
		lblLogo.setBounds(21, 6, 374, 89);
		contentPane.add(lblLogo);
	}
}
